package com.dream.keigezhushou.Activity.kege.acty;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.dream.keigezhushou.Activity.Uiutils.StringUtils;
import com.dream.keigezhushou.Activity.Uiutils.UiUtils;
import com.dream.keigezhushou.Activity.kege.adapter.KeMyAttentionAdapter;
import com.dream.keigezhushou.Activity.kege.adapter.MyAttentionListAdapter;
import com.dream.keigezhushou.R;
import com.handmark.pulltorefresh.library.PullToRefreshListView;

import butterknife.BindView;
import butterknife.ButterKnife;


/**
 * 发布完成
 */
public class ReleaseFinishActivity extends AppCompatActivity {

    @BindView(R.id.iv_return)
    ImageView ivReturn;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.list_lv)
    PullToRefreshListView mPullToRefreshListView;

    @BindView(R.id.release_edittext_linear)
    EditText evaluateEt;

    private ListView mListView;
    private View heardView;

    private KeMyAttentionAdapter adapter;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_release_finish);
        ButterKnife.bind(this);

        initView();
        initOnClick();


    }


    public void initView() {
        tvTitle.setText("动态");
        evaluateEt.setVisibility(View.GONE);
        mListView = mPullToRefreshListView.getRefreshableView();
        heardView = UiUtils.inflateView(R.layout.release_finish_heard);
        mListView.addHeaderView(heardView);
        adapter = new KeMyAttentionAdapter(ReleaseFinishActivity.this);
        mListView.setAdapter(adapter);

    }


    public void initOnClick() {

        ivReturn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });


        adapter.setItemOnClickListening(new KeMyAttentionAdapter.ItemOnClickListening() {
            @Override
            public void onItemClick(int position) {

                Intent intent = new Intent();
                intent.putExtra(StringUtils.KEGESTATE, "听歌");
                intent.setClass(ReleaseFinishActivity.this, SingingDetailActivity.class);
                startActivity(intent);


            }

            @Override
            public void onEvaluateClick(int position) {

            }

            @Override
            public void onShareClick(int position) {

            }
        });
    }

}
